home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / Devices.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  23.2 KB  |  720 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Devices.h
  3.  
  4.      Contains:    Device Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1985-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __DEVICES__
  19. #define __DEVICES__
  20.  
  21. #ifndef __OSUTILS__
  22. #include <OSUtils.h>
  23. #endif
  24. #ifndef __FILES__
  25. #include <Files.h>
  26. #endif
  27. #ifndef __QUICKDRAW__
  28. #include <Quickdraw.h>
  29. #endif
  30. #ifndef __NAMEREGISTRY__
  31. #include <NameRegistry.h>
  32. #endif
  33. #ifndef __CODEFRAGMENTS__
  34. #include <CodeFragments.h>
  35. #endif
  36. #ifndef __DRIVERFAMILYMATCHING__
  37. #include <DriverFamilyMatching.h>
  38. #endif
  39.  
  40.  
  41.  
  42. #if PRAGMA_ONCE
  43. #pragma once
  44. #endif
  45.  
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49.  
  50. #if PRAGMA_IMPORT
  51. #pragma import on
  52. #endif
  53.  
  54. #if PRAGMA_STRUCT_ALIGN
  55.     #pragma options align=mac68k
  56. #elif PRAGMA_STRUCT_PACKPUSH
  57.     #pragma pack(push, 2)
  58. #elif PRAGMA_STRUCT_PACK
  59.     #pragma pack(2)
  60. #endif
  61.  
  62. /* Values of the 'message' parameter to a Chooser device package */
  63.  
  64. enum {
  65.     chooserInitMsg                = 11,                            /* the user selected this device package */
  66.     newSelMsg                    = 12,                            /* the user made new device selections */
  67.     fillListMsg                    = 13,                            /* fill the device list with choices */
  68.     getSelMsg                    = 14,                            /* mark one or more choices as selected */
  69.     selectMsg                    = 15,                            /* the user made a selection */
  70.     deselectMsg                    = 16,                            /* the user canceled a selection */
  71.     terminateMsg                = 17,                            /* allows device package to clean up */
  72.     buttonMsg                    = 19                            /* the user selected a button */
  73. };
  74.  
  75.  
  76. /* Values of the 'caller' parameter to a Chooser device package */
  77.  
  78. enum {
  79.     chooserID                    = 1
  80. };
  81.  
  82.  
  83. /* Values of the 'message' parameter to a Monitor 'mntr' */
  84.  
  85. enum {
  86.     initMsg                        = 1,                            /*initialization*/
  87.     okMsg                        = 2,                            /*user clicked OK button*/
  88.     cancelMsg                    = 3,                            /*user clicked Cancel button*/
  89.     hitMsg                        = 4,                            /*user clicked control in Options dialog*/
  90.     nulMsg                        = 5,                            /*periodic event*/
  91.     updateMsg                    = 6,                            /*update event*/
  92.     activateMsg                    = 7,                            /*not used*/
  93.     deactivateMsg                = 8,                            /*not used*/
  94.     keyEvtMsg                    = 9,                            /*keyboard event*/
  95.     superMsg                    = 10,                            /*show superuser controls*/
  96.     normalMsg                    = 11,                            /*show only normal controls*/
  97.     startupMsg                    = 12                            /*code has been loaded*/
  98. };
  99.  
  100.  
  101. /* control codes for DeskAccessories */
  102.  
  103. enum {
  104.     goodbye                        = -1,                            /* heap being reinitialized */
  105.     killCode                    = 1,                            /* KillIO requested */
  106.     accEvent                    = 64,                            /* handle an event */
  107.     accRun                        = 65,                            /* time for periodic action */
  108.     accCursor                    = 66,                            /* change cursor shape */
  109.     accMenu                        = 67,                            /* handle menu item */
  110.     accUndo                        = 68,                            /* handle undo command */
  111.     accCut                        = 70,                            /* handle cut command */
  112.     accCopy                        = 71,                            /* handle copy command */
  113.     accPaste                    = 72,                            /* handle paste command */
  114.     accClear                    = 73                            /* handle clear command */
  115. };
  116.  
  117. /* Control/Status Call Codes */
  118.  
  119. enum {
  120.     drvStsCode                    = 8,                            /* status call code for drive status */
  121.     ejectCode                    = 7,                            /* control call eject code */
  122.     tgBuffCode                    = 8                                /* set tag buffer code */
  123. };
  124.  
  125. /* miscellaneous Device Manager constants */
  126.  
  127. enum {
  128.     ioInProgress                = 1,                            /* predefined value of ioResult while I/O is pending */
  129.     aRdCmd                        = 2,                            /* low byte of ioTrap for Read calls */
  130.     aWrCmd                        = 3,                            /* low byte of ioTrap for Write calls */
  131.     asyncTrpBit                    = 10,                            /* trap word modifier */
  132.     noQueueBit                    = 9                                /* trap word modifier */
  133. };
  134.  
  135. /* flags used in the driver header and device control entry */
  136.  
  137. enum {
  138.     dReadEnable                    = 0,                            /* set if driver responds to read requests */
  139.     dWritEnable                    = 1,                            /* set if driver responds to write requests */
  140.     dCtlEnable                    = 2,                            /* set if driver responds to control requests */
  141.     dStatEnable                    = 3,                            /* set if driver responds to status requests */
  142.     dNeedGoodBye                = 4,                            /* set if driver needs time for performing periodic tasks */
  143.     dNeedTime                    = 5,                            /* set if driver needs time for performing periodic tasks */
  144.     dNeedLock                    = 6                                /* set if driver must be locked in memory as soon as it is opened */
  145. };
  146.  
  147.  
  148. enum {
  149.     dNeedLockMask                = 0x4000,                        /* set if driver must be locked in memory as soon as it is opened */
  150.     dNeedTimeMask                = 0x2000,                        /* set if driver needs time for performing periodic tasks */
  151.     dNeedGoodByeMask            = 0x1000,                        /* set if driver needs to be called before the application heap is initialized */
  152.     dStatEnableMask                = 0x0800,                        /* set if driver responds to status requests */
  153.     dCtlEnableMask                = 0x0400,                        /* set if driver responds to control requests */
  154.     dWritEnableMask                = 0x0200,                        /* set if driver responds to write requests */
  155.     dReadEnableMask                = 0x0100                        /* set if driver responds to read requests */
  156. };
  157.  
  158.  
  159. /* run-time flags used in the device control entry */
  160.  
  161. enum {
  162.     dOpened                        = 5,                            /* driver is open */
  163.     dRAMBased                    = 6,                            /* dCtlDriver is a handle (1) or pointer (0) */
  164.     drvrActive                    = 7                                /* driver is currently processing a request */
  165. };
  166.  
  167.  
  168. enum {
  169.     drvrActiveMask                = 0x0080,                        /* driver is currently processing a request */
  170.     dRAMBasedMask                = 0x0040,                        /* dCtlDriver is a handle (1) or pointer (0) */
  171.     dOpenedMask                    = 0x0020                        /* driver is open */
  172. };
  173.  
  174.  
  175. struct DRVRHeader {
  176.     short                             drvrFlags;
  177.     short                             drvrDelay;
  178.     short                             drvrEMask;
  179.     short                             drvrMenu;
  180.     short                             drvrOpen;
  181.     short                             drvrPrime;
  182.     short                             drvrCtl;
  183.     short                             drvrStatus;
  184.     short                             drvrClose;
  185.     unsigned char                     drvrName[1];
  186. };
  187. typedef struct DRVRHeader DRVRHeader;
  188.  
  189. typedef DRVRHeader *                    DRVRHeaderPtr;
  190. typedef DRVRHeaderPtr *                    DRVRHeaderHandle;
  191. struct DCtlEntry {
  192.     Ptr                             dCtlDriver;
  193.     short                             dCtlFlags;
  194.     QHdr                             dCtlQHdr;
  195.     long                             dCtlPosition;
  196.     Handle                             dCtlStorage;
  197.     short                             dCtlRefNum;
  198.     long                             dCtlCurTicks;
  199.     GrafPtr                         dCtlWindow;
  200.     short                             dCtlDelay;
  201.     short                             dCtlEMask;
  202.     short                             dCtlMenu;
  203. };
  204. typedef struct DCtlEntry DCtlEntry;
  205.  
  206. typedef DCtlEntry *                        DCtlPtr;
  207. typedef DCtlPtr *                        DCtlHandle;
  208. struct AuxDCE {
  209.     Ptr                             dCtlDriver;
  210.     short                             dCtlFlags;
  211.     QHdr                             dCtlQHdr;
  212.     long                             dCtlPosition;
  213.     Handle                             dCtlStorage;
  214.     short                             dCtlRefNum;
  215.     long                             dCtlCurTicks;
  216.     GrafPtr                         dCtlWindow;
  217.     short                             dCtlDelay;
  218.     short                             dCtlEMask;
  219.     short                             dCtlMenu;
  220.     SInt8                             dCtlSlot;
  221.     SInt8                             dCtlSlotId;
  222.     long                             dCtlDevBase;
  223.     Ptr                             dCtlOwner;
  224.     SInt8                             dCtlExtDev;
  225.     SInt8                             fillByte;
  226.     UInt32                             dCtlNodeID;
  227. };
  228. typedef struct AuxDCE AuxDCE;
  229.  
  230. typedef AuxDCE *                        AuxDCEPtr;
  231. typedef AuxDCEPtr *                        AuxDCEHandle;
  232. /*    The NDRV Driver IO Entry Point and Commands */
  233. typedef UInt16                             UnitNumber;
  234. typedef UInt32                             DriverOpenCount;
  235. typedef SInt16                             DriverRefNum;
  236. typedef SInt16                             DriverFlags;
  237. typedef UInt32                             IOCommandCode;
  238.  
  239. enum {
  240.     kOpenCommand                = 0,
  241.     kCloseCommand                = 1,
  242.     kReadCommand                = 2,
  243.     kWriteCommand                = 3,
  244.     kControlCommand                = 4,
  245.     kStatusCommand                = 5,
  246.     kKillIOCommand                = 6,
  247.     kInitializeCommand            = 7,                            /* init driver and device*/
  248.     kFinalizeCommand            = 8,                            /* shutdown driver and device*/
  249.     kReplaceCommand                = 9,                            /* replace an old driver*/
  250.     kSupersededCommand            = 10,                            /* prepare to be replaced by a new driver*/
  251.     kSuspendCommand                = 11,                            /* prepare driver to go to sleep*/
  252.     kResumeCommand                = 12                            /* wake up sleeping driver*/
  253. };
  254.  
  255. typedef struct OpaqueAddressSpaceID*     AddressSpaceID;
  256. typedef struct OpaqueIOCommandID*         IOCommandID;
  257. typedef UInt32                             IOCommandKind;
  258.  
  259. enum {
  260.     kSynchronousIOCommandKind    = 0x00000001,
  261.     kAsynchronousIOCommandKind    = 0x00000002,
  262.     kImmediateIOCommandKind        = 0x00000004
  263. };
  264.  
  265. struct DriverInitInfo {
  266.     DriverRefNum                     refNum;
  267.     RegEntryID                         deviceEntry;
  268. };
  269. typedef struct DriverInitInfo DriverInitInfo;
  270.  
  271. typedef DriverInitInfo *                DriverInitInfoPtr;
  272. typedef DriverInitInfo                     DriverReplaceInfo;
  273. typedef DriverInitInfo *                DriverReplaceInfoPtr;
  274. struct DriverFinalInfo {
  275.     DriverRefNum                     refNum;
  276.     RegEntryID                         deviceEntry;
  277. };
  278. typedef struct DriverFinalInfo DriverFinalInfo;
  279.  
  280. typedef DriverFinalInfo *                DriverFinalInfoPtr;
  281. typedef DriverFinalInfo                 DriverSupersededInfo;
  282. typedef DriverFinalInfo *                DriverSupersededInfoPtr;
  283.  
  284. /* Contents are command specific*/
  285.  
  286. union IOCommandContents {
  287.     ParmBlkPtr                         pb;
  288.     DriverInitInfoPtr                 initialInfo;
  289.     DriverFinalInfoPtr                 finalInfo;
  290.     DriverReplaceInfoPtr             replaceInfo;
  291.     DriverSupersededInfoPtr         supersededInfo;
  292. };
  293. typedef union IOCommandContents IOCommandContents;
  294.  
  295. typedef CALLBACK_API_C( OSErr , DriverEntryPointPtr )(AddressSpaceID SpaceID, IOCommandID CommandID, IOCommandContents Contents, IOCommandCode Code, IOCommandKind Kind);
  296. /* Record to describe a file-based driver candidate */
  297. struct FileBasedDriverRecord {
  298.     FSSpec                             theSpec;                    /* file specification*/
  299.     DriverType                         theType;                    /* nameInfoStr + version number*/
  300.     Boolean                         compatibleProp;                /* true if matched using a compatible name*/
  301.     UInt8                             pad[3];                        /* alignment*/
  302. };
  303. typedef struct FileBasedDriverRecord FileBasedDriverRecord;
  304.  
  305. typedef FileBasedDriverRecord *            FileBasedDriverRecordPtr;
  306. /* Driver Loader API */
  307. #define DECLARE_DRIVERDESCRIPTION(N_ADDITIONAL_SERVICES)\
  308.         struct {\
  309.             DriverDescription    fixed;\
  310.             DriverServiceInfo    additional_service[N_ADDITIONAL_SERVICES-1];\
  311.         };
  312.  
  313.  
  314. EXTERN_API_C( SInt16 )
  315. HigherDriverVersion                (NumVersion *            driverVersion1,
  316.                                  NumVersion *            driverVersion2);
  317.  
  318. EXTERN_API_C( OSErr )
  319. VerifyFragmentAsDriver            (CFragConnectionID         fragmentConnID,
  320.                                  DriverEntryPointPtr *    fragmentMain,
  321.                                  DriverDescriptionPtr *    driverDesc);
  322.  
  323. EXTERN_API_C( OSErr )
  324. GetDriverMemoryFragment            (Ptr                     memAddr,
  325.                                  long                     length,
  326.                                  ConstStr63Param         fragName,
  327.                                  CFragConnectionID *    fragmentConnID,
  328.                                  DriverEntryPointPtr *    fragmentMain,
  329.                                  DriverDescriptionPtr *    driverDesc);
  330.  
  331. EXTERN_API_C( OSErr )
  332. GetDriverDiskFragment            (FSSpecPtr                 fragmentSpec,
  333.                                  CFragConnectionID *    fragmentConnID,
  334.                                  DriverEntryPointPtr *    fragmentMain,
  335.                                  DriverDescriptionPtr *    driverDesc);
  336.  
  337. EXTERN_API_C( OSErr )
  338. InstallDriverFromFragment        (CFragConnectionID         fragmentConnID,
  339.                                  RegEntryID *            device,
  340.                                  UnitNumber             beginningUnit,
  341.                                  UnitNumber             endingUnit,
  342.                                  DriverRefNum *            refNum);
  343.  
  344. EXTERN_API_C( OSErr )
  345. InstallDriverFromFile            (FSSpecPtr                 fragmentSpec,
  346.                                  RegEntryID *            device,
  347.                                  UnitNumber             beginningUnit,
  348.                                  UnitNumber             endingUnit,
  349.                                  DriverRefNum *            refNum);
  350.  
  351. EXTERN_API_C( OSErr )
  352. InstallDriverFromMemory            (Ptr                     memory,
  353.                                  long                     length,
  354.                                  ConstStr63Param         fragName,
  355.                                  RegEntryID *            device,
  356.                                  UnitNumber             beginningUnit,
  357.                                  UnitNumber             endingUnit,
  358.                                  DriverRefNum *            refNum);
  359.  
  360. EXTERN_API_C( OSErr )
  361. InstallDriverFromDisk            (Ptr                     theDriverName,
  362.                                  RegEntryID *            theDevice,
  363.                                  UnitNumber             theBeginningUnit,
  364.                                  UnitNumber             theEndingUnit,
  365.                                  DriverRefNum *            theRefNum);
  366.  
  367. EXTERN_API_C( OSErr )
  368. FindDriversForDevice            (RegEntryID *            device,
  369.                                  FSSpec *                fragmentSpec,
  370.                                  DriverDescription *    fileDriverDesc,
  371.                                  Ptr *                    memAddr,
  372.                                  long *                    length,
  373.                                  StringPtr                 fragName,
  374.                                  DriverDescription *    memDriverDesc);
  375.  
  376. EXTERN_API_C( OSErr )
  377. FindDriverCandidates            (RegEntryID *            deviceID,
  378.                                  Ptr *                    propBasedDriver,
  379.                                  RegPropertyValueSize *    propBasedDriverSize,
  380.                                  StringPtr                 deviceName,
  381.                                  DriverType *            propBasedDriverType,
  382.                                  Boolean *                gotPropBasedDriver,
  383.                                  FileBasedDriverRecordPtr  fileBasedDrivers,
  384.                                  ItemCount *            nFileBasedDrivers);
  385.  
  386. EXTERN_API_C( OSErr )
  387. ScanDriverCandidates            (RegEntryID *            deviceID,
  388.                                  FileBasedDriverRecordPtr  fileBasedDrivers,
  389.                                  ItemCount                 nFileBasedDrivers,
  390.                                  FileBasedDriverRecordPtr  matchingDrivers,
  391.                                  ItemCount *            nMatchingDrivers);
  392.  
  393. EXTERN_API_C( OSErr )
  394. GetDriverForDevice                (RegEntryID *            device,
  395.                                  CFragConnectionID *    fragmentConnID,
  396.                                  DriverEntryPointPtr *    fragmentMain,
  397.                                  DriverDescriptionPtr *    driverDesc);
  398.  
  399. EXTERN_API_C( OSErr )
  400. InstallDriverForDevice            (RegEntryID *            device,
  401.                                  UnitNumber             beginningUnit,
  402.                                  UnitNumber             endingUnit,
  403.                                  DriverRefNum *            refNum);
  404.  
  405. EXTERN_API_C( OSErr )
  406. GetDriverInformation            (DriverRefNum             refNum,
  407.                                  UnitNumber *            unitNum,
  408.                                  DriverFlags *            flags,
  409.                                  DriverOpenCount *        count,
  410.                                  StringPtr                 name,
  411.                                  RegEntryID *            device,
  412.                                  CFragSystem7Locator *    driverLoadLocation,
  413.                                  CFragConnectionID *    fragmentConnID,
  414.                                  DriverEntryPointPtr *    fragmentMain,
  415.                                  DriverDescription *    driverDesc);
  416.  
  417. EXTERN_API_C( OSErr )
  418. GetDriverDescription            (LogicalAddress         fragmentPtr,
  419.                                  DriverDescriptionPtr *    theDriverDesc);
  420.  
  421. EXTERN_API_C( OSErr )
  422. SetDriverClosureMemory            (CFragConnectionID         fragmentConnID,
  423.                                  Boolean                 holdDriverMemory);
  424.  
  425. EXTERN_API_C( OSErr )
  426. ReplaceDriverWithFragment        (DriverRefNum             theRefNum,
  427.                                  CFragConnectionID         fragmentConnID);
  428.  
  429. EXTERN_API_C( OSErr )
  430. OpenInstalledDriver                (DriverRefNum             refNum,
  431.                                  SInt8                     ioPermission);
  432.  
  433. EXTERN_API_C( OSErr )
  434. RenameDriver                    (DriverRefNum             refNum,
  435.                                  StringPtr                 newDriverName);
  436.  
  437. EXTERN_API_C( OSErr )
  438. RemoveDriver                    (DriverRefNum             refNum,
  439.                                  Boolean                 immediate);
  440.  
  441. EXTERN_API_C( OSErr )
  442. LookupDrivers                    (UnitNumber             beginningUnit,
  443.                                  UnitNumber             endingUnit,
  444.                                  Boolean                 emptyUnits,
  445.                                  ItemCount *            returnedRefNums,
  446.                                  DriverRefNum *            refNums);
  447.  
  448. EXTERN_API_C( UnitNumber )
  449. HighestUnitNumber                (void);
  450.  
  451. EXTERN_API_C( OSErr )
  452. DriverGestaltOn                    (DriverRefNum             refNum);
  453.  
  454. EXTERN_API_C( OSErr )
  455. DriverGestaltOff                (DriverRefNum             refNum);
  456.  
  457. EXTERN_API_C( Boolean )
  458. DriverGestaltIsOn                (DriverFlags             flags);
  459.  
  460.  
  461. #if !OLDROUTINELOCATIONS
  462.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  463.                                                                                             #pragma parameter __D0 PBOpenSync(__A0)
  464.                                                                                             #endif
  465. EXTERN_API( OSErr )
  466. PBOpenSync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA000);
  467.  
  468.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  469.                                                                                             #pragma parameter __D0 PBOpenAsync(__A0)
  470.                                                                                             #endif
  471. EXTERN_API( OSErr )
  472. PBOpenAsync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA400);
  473.  
  474.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  475.                                                                                             #pragma parameter __D0 PBOpenImmed(__A0)
  476.                                                                                             #endif
  477. EXTERN_API( OSErr )
  478. PBOpenImmed                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA200);
  479.  
  480.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  481.                                                                                             #pragma parameter __D0 PBCloseSync(__A0)
  482.                                                                                             #endif
  483. EXTERN_API( OSErr )
  484. PBCloseSync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA001);
  485.  
  486.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  487.                                                                                             #pragma parameter __D0 PBCloseAsync(__A0)
  488.                                                                                             #endif
  489. EXTERN_API( OSErr )
  490. PBCloseAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA401);
  491.  
  492.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  493.                                                                                             #pragma parameter __D0 PBCloseImmed(__A0)
  494.                                                                                             #endif
  495. EXTERN_API( OSErr )
  496. PBCloseImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA201);
  497.  
  498.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  499.                                                                                             #pragma parameter __D0 PBReadSync(__A0)
  500.                                                                                             #endif
  501. EXTERN_API( OSErr )
  502. PBReadSync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA002);
  503.  
  504.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  505.                                                                                             #pragma parameter __D0 PBReadAsync(__A0)
  506.                                                                                             #endif
  507. EXTERN_API( OSErr )
  508. PBReadAsync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA402);
  509.  
  510.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  511.                                                                                             #pragma parameter __D0 PBReadImmed(__A0)
  512.                                                                                             #endif
  513. EXTERN_API( OSErr )
  514. PBReadImmed                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA202);
  515.  
  516.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  517.                                                                                             #pragma parameter __D0 PBWriteSync(__A0)
  518.                                                                                             #endif
  519. EXTERN_API( OSErr )
  520. PBWriteSync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA003);
  521.  
  522.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  523.                                                                                             #pragma parameter __D0 PBWriteAsync(__A0)
  524.                                                                                             #endif
  525. EXTERN_API( OSErr )
  526. PBWriteAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA403);
  527.  
  528.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  529.                                                                                             #pragma parameter __D0 PBWriteImmed(__A0)
  530.                                                                                             #endif
  531. EXTERN_API( OSErr )
  532. PBWriteImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA203);
  533.  
  534. EXTERN_API( void )
  535. AddDrive                        (short                     drvrRefNum,
  536.                                  short                     drvNum,
  537.                                  DrvQElPtr                 qEl);
  538.  
  539. EXTERN_API( QHdrPtr )
  540. GetDrvQHdr                        (void)                                                        THREEWORDINLINE(0x2EBC, 0x0000, 0x0308);
  541.  
  542. #endif  /*  !OLDROUTINELOCATIONS */
  543.  
  544. EXTERN_API( DCtlHandle )
  545. GetDCtlEntry                    (short                     refNum);
  546.  
  547. /*
  548.     SetChooserAlert used to simply set a bit in a low-mem global
  549.     to tell the Chooser not to display its warning message when
  550.     the printer is changed. However, under MultiFinder and System 7,
  551.     this low-mem is swapped out when a layer change occurs, and the
  552.     Chooser never sees the change. It is obsolete, and completely
  553.     unsupported on the PowerPC. 68K apps can still call it if they
  554.     wish.
  555.     
  556.     pascal Boolean SetChooserAlert(Boolean f);
  557.  
  558. */
  559.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  560.                                                                                             #pragma parameter __D0 DriverInstall(__A0, __D0)
  561.                                                                                             #endif
  562. EXTERN_API( OSErr )
  563. DriverInstall                    (DRVRHeaderPtr             drvrPtr,
  564.                                  short                     refNum)                                ONEWORDINLINE(0xA03D);
  565.  
  566.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  567.                                                                                             #pragma parameter __D0 DriverInstallReserveMem(__A0, __D0)
  568.                                                                                             #endif
  569. EXTERN_API( OSErr )
  570. DriverInstallReserveMem            (DRVRHeaderPtr             drvrPtr,
  571.                                  short                     refNum)                                ONEWORDINLINE(0xA43D);
  572.  
  573. /*
  574.   Note: DrvrInstall() is no longer supported, becuase it never really worked anyways.
  575.           There will soon be a DriverInstall() which does the right thing.
  576.  
  577.         DrvrRemove has been renamed to DriverRemove.  But, InterfaceLib for PowerPC
  578.         still exports DrvrRemove, so a macro is used to map the new name to old.
  579.  
  580. */
  581.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  582.                                                                                             #pragma parameter __D0 DrvrRemove(__D0)
  583.                                                                                             #endif
  584. EXTERN_API( OSErr )
  585. DrvrRemove                        (short                     refNum)                                ONEWORDINLINE(0xA03E);
  586.  
  587. #define DriverRemove(refNum) DrvrRemove(refNum)
  588.  
  589. EXTERN_API( OSErr )
  590. OpenDriver                        (ConstStr255Param         name,
  591.                                  short *                drvrRefNum);
  592.  
  593. EXTERN_API( OSErr )
  594. CloseDriver                        (short                     refNum);
  595.  
  596. EXTERN_API( OSErr )
  597. Control                            (short                     refNum,
  598.                                  short                     csCode,
  599.                                  const void *            csParamPtr);
  600.  
  601. EXTERN_API( OSErr )
  602. Status                            (short                     refNum,
  603.                                  short                     csCode,
  604.                                  void *                    csParamPtr);
  605.  
  606. EXTERN_API( OSErr )
  607. KillIO                            (short                     refNum);
  608.  
  609.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  610.                                                                                             #pragma parameter __D0 PBControlSync(__A0)
  611.                                                                                             #endif
  612. EXTERN_API( OSErr )
  613. PBControlSync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA004);
  614.  
  615.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  616.                                                                                             #pragma parameter __D0 PBControlAsync(__A0)
  617.                                                                                             #endif
  618. EXTERN_API( OSErr )
  619. PBControlAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA404);
  620.  
  621.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  622.                                                                                             #pragma parameter __D0 PBControlImmed(__A0)
  623.                                                                                             #endif
  624. EXTERN_API( OSErr )
  625. PBControlImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA204);
  626.  
  627.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  628.                                                                                             #pragma parameter __D0 PBStatusSync(__A0)
  629.                                                                                             #endif
  630. EXTERN_API( OSErr )
  631. PBStatusSync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA005);
  632.  
  633.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  634.                                                                                             #pragma parameter __D0 PBStatusAsync(__A0)
  635.                                                                                             #endif
  636. EXTERN_API( OSErr )
  637. PBStatusAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA405);
  638.  
  639.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  640.                                                                                             #pragma parameter __D0 PBStatusImmed(__A0)
  641.                                                                                             #endif
  642. EXTERN_API( OSErr )
  643. PBStatusImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA205);
  644.  
  645.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  646.                                                                                             #pragma parameter __D0 PBKillIOSync(__A0)
  647.                                                                                             #endif
  648. EXTERN_API( OSErr )
  649. PBKillIOSync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA006);
  650.  
  651.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  652.                                                                                             #pragma parameter __D0 PBKillIOAsync(__A0)
  653.                                                                                             #endif
  654. EXTERN_API( OSErr )
  655. PBKillIOAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA406);
  656.  
  657.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  658.                                                                                             #pragma parameter __D0 PBKillIOImmed(__A0)
  659.                                                                                             #endif
  660. EXTERN_API( OSErr )
  661. PBKillIOImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA206);
  662.  
  663. EXTERN_API( short )
  664. OpenDeskAcc                        (ConstStr255Param         deskAccName)                        ONEWORDINLINE(0xA9B6);
  665.  
  666. EXTERN_API( void )
  667. CloseDeskAcc                    (short                     refNum)                                ONEWORDINLINE(0xA9B7);
  668.  
  669. #if CGLUESUPPORTED
  670. EXTERN_API_C( short )
  671. opendeskacc                        (const char *            deskAccName);
  672.  
  673. EXTERN_API_C( OSErr )
  674. opendriver                        (const char *            driverName,
  675.                                  short *                refNum);
  676.  
  677. #endif  /* CGLUESUPPORTED */
  678.  
  679. /*
  680.     The PBxxx() routines are obsolete.  
  681.     
  682.     Use the PBxxxSync(), PBxxxAsync(), or PBxxxImmed version instead.
  683. */
  684. #define PBControl(pb, async) ((async) ? PBControlAsync(pb) : PBControlSync(pb))
  685. #define PBStatus(pb, async) ((async) ? PBStatusAsync(pb) : PBStatusSync(pb))
  686. #define PBKillIO(pb, async) ((async) ? PBKillIOAsync(pb) : PBKillIOSync(pb))
  687.  
  688. #if !OLDROUTINELOCATIONS
  689. #define PBOpen(pb, async) ((async) ? PBOpenAsync(pb) : PBOpenSync(pb))
  690. #define PBClose(pb, async) ((async) ? PBCloseAsync(pb) : PBCloseSync(pb))
  691. #define PBRead(pb, async) ((async) ? PBReadAsync(pb) : PBReadSync(pb))
  692. #define PBWrite(pb, async) ((async) ? PBWriteAsync(pb) : PBWriteSync(pb))
  693. #endif  /*  !OLDROUTINELOCATIONS */
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700. #if PRAGMA_STRUCT_ALIGN
  701.     #pragma options align=reset
  702. #elif PRAGMA_STRUCT_PACKPUSH
  703.     #pragma pack(pop)
  704. #elif PRAGMA_STRUCT_PACK
  705.     #pragma pack()
  706. #endif
  707.  
  708. #ifdef PRAGMA_IMPORT_OFF
  709. #pragma import off
  710. #elif PRAGMA_IMPORT
  711. #pragma import reset
  712. #endif
  713.  
  714. #ifdef __cplusplus
  715. }
  716. #endif
  717.  
  718. #endif /* __DEVICES__ */
  719.  
  720.